Skip to contentSkip to conversation

Change in openvpn[master]: gerrit-send-mail: add missing Signed-off-by

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Mar 4, 2024 – Mar 8, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1709557301000.If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/530?usp=email

to review the following change.

Change subject: gerrit-send-mail: add missing Signed-off-by
......................................................................

gerrit-send-mail: add missing Signed-off-by

Our development documentation says we add this automatically when it is missing. So let's do that here as well.

Change-Id If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa

---
M dev-tools/gerrit-send-mail.py

1 file changed, 13 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/30/530/1

dev-tools/gerrit-send-mail.py +13 -0
index 67a2cf1..10305e2 100755
@@ -50,6 +50,12 @@
                 ack = f"{reviewer_name} <{reviewer_mail}>"
                 print(f"Acked-by: {ack}")
                 acked_by.append(ack)
+    # construct Signed-off-by in case it is missing
+    owner = json_data["owner"]
+    owner_name = owner.get("display_name", owner["name"])
+    owner_mail = owner.get("email", owner["name"])
+    sign_off = f"{owner_name} <{owner_mail}>"
+    print(f"Signed-off-by: {sign_off}")
     change_id = json_data["change_id"]
     # assumes that the created date in Gerrit is in UTC
     utc_stamp = (
@@ -67,6 +73,7 @@
         "target": json_data["branch"],
         "msg_id": msg_id,
         "acked_by": acked_by,
+        "sign_off": sign_off,
     }
 
 
@@ -81,10 +88,14 @@
 
 def apply_patch_mods(patch_text, details, args):
     comment_start = patch_text.index("\n---\n") + len("\n---\n")
+    signed_off_text = ""
+    signed_off_comment = ""
     try:
         signed_off_start = patch_text.rindex("\nSigned-off-by: ")
         signed_off_end = patch_text.index("\n", signed_off_start + 1) + 1
     except ValueError:  # Signed-off missing
+        signed_off_text = f"Signed-off-by: {details['sign_off']}\n"
+        signed_off_comment = "\nSigned-off-by line for the author was added as per our policy.\n"
         signed_off_end = patch_text.index("\n---\n") + 1
     assert comment_start > signed_off_end
     acked_by_text = ""
@@ -94,6 +105,7 @@
         acked_by_names += f"{ack}\n"
     patch_text_mod = (
         patch_text[:signed_off_end]
+        + signed_off_text
         + acked_by_text
         + patch_text[signed_off_end:comment_start]
         + f"""
@@ -102,6 +114,7 @@
 
 Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid}
 This mail reflects revision {details["revision"]} of this Change.
+{signed_off_comment}
 Acked-by according to Gerrit (reflected above):
 {acked_by_names}
         """

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa
Gerrit-Change-Number: 530
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/530?usp=email )

Change subject: gerrit-send-mail: add missing Signed-off-by
......................................................................

Patch Set 1: Code-Review+2

(1 comment)

Patchset:

PS1:
looks reasonable. Given that it's a language I refuse to understand I can't say for sure, but good enough still.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa
Gerrit-Change-Number: 530
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 08 Mar 2024 12:05:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 gerrit-send-mail: add missing Signed-off-by

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Our development documentation says we add this automatically when it is missing. So let's do that here as well.

Change-Id If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/530
This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

dev-tools/gerrit-send-mail.py +13 -0
index 67a2cf1..10305e2 100755
@@ -50,6 +50,12 @@
                 ack = f"{reviewer_name} <{reviewer_mail}>"
                 print(f"Acked-by: {ack}")
                 acked_by.append(ack)
+    # construct Signed-off-by in case it is missing
+    owner = json_data["owner"]
+    owner_name = owner.get("display_name", owner["name"])
+    owner_mail = owner.get("email", owner["name"])
+    sign_off = f"{owner_name} <{owner_mail}>"
+    print(f"Signed-off-by: {sign_off}")
     change_id = json_data["change_id"]
     # assumes that the created date in Gerrit is in UTC
     utc_stamp = (
@@ -67,6 +73,7 @@
         "target": json_data["branch"],
         "msg_id": msg_id,
         "acked_by": acked_by,
+        "sign_off": sign_off,
     }
 
 
@@ -81,10 +88,14 @@
 
 def apply_patch_mods(patch_text, details, args):
     comment_start = patch_text.index("\n---\n") + len("\n---\n")
+    signed_off_text = ""
+    signed_off_comment = ""
     try:
         signed_off_start = patch_text.rindex("\nSigned-off-by: ")
         signed_off_end = patch_text.index("\n", signed_off_start + 1) + 1
     except ValueError:  # Signed-off missing
+        signed_off_text = f"Signed-off-by: {details['sign_off']}\n"
+        signed_off_comment = "\nSigned-off-by line for the author was added as per our policy.\n"
         signed_off_end = patch_text.index("\n---\n") + 1
     assert comment_start > signed_off_end
     acked_by_text = ""
@@ -94,6 +105,7 @@
         acked_by_names += f"{ack}\n"
     patch_text_mod = (
         patch_text[:signed_off_end]
+        + signed_off_text
         + acked_by_text
         + patch_text[signed_off_end:comment_start]
         + f"""
@@ -102,6 +114,7 @@
 
 Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid}
 This mail reflects revision {details["revision"]} of this Change.
+{signed_off_comment}
 Acked-by according to Gerrit (reflected above):
 {acked_by_names}
         """
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: gerrit-send-mail: add missing Signed-off-by

Your patch has been applied to the master branch.

commit bea088cf8ae3382aeed420da2a39f2a9f52df4cd

Author: Frank Lichtenheld
Date:   Fri Mar 8 13:05:57 2024 +0100
     gerrit-send-mail: add missing Signed-off-by

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28362.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/530?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: gerrit-send-mail: add missing Signed-off-by
......................................................................

gerrit-send-mail: add missing Signed-off-by

Our development documentation says we add this automatically when it is missing. So let's do that here as well.

Change-Id If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28362.html

---
M dev-tools/gerrit-send-mail.py

1 file changed, 13 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/30/530/2

dev-tools/gerrit-send-mail.py +13 -0
index 67a2cf1..10305e2 100755
@@ -50,6 +50,12 @@
                 ack = f"{reviewer_name} <{reviewer_mail}>"
                 print(f"Acked-by: {ack}")
                 acked_by.append(ack)
+    # construct Signed-off-by in case it is missing
+    owner = json_data["owner"]
+    owner_name = owner.get("display_name", owner["name"])
+    owner_mail = owner.get("email", owner["name"])
+    sign_off = f"{owner_name} <{owner_mail}>"
+    print(f"Signed-off-by: {sign_off}")
     change_id = json_data["change_id"]
     # assumes that the created date in Gerrit is in UTC
     utc_stamp = (
@@ -67,6 +73,7 @@
         "target": json_data["branch"],
         "msg_id": msg_id,
         "acked_by": acked_by,
+        "sign_off": sign_off,
     }
 
 
@@ -81,10 +88,14 @@
 
 def apply_patch_mods(patch_text, details, args):
     comment_start = patch_text.index("\n---\n") + len("\n---\n")
+    signed_off_text = ""
+    signed_off_comment = ""
     try:
         signed_off_start = patch_text.rindex("\nSigned-off-by: ")
         signed_off_end = patch_text.index("\n", signed_off_start + 1) + 1
     except ValueError:  # Signed-off missing
+        signed_off_text = f"Signed-off-by: {details['sign_off']}\n"
+        signed_off_comment = "\nSigned-off-by line for the author was added as per our policy.\n"
         signed_off_end = patch_text.index("\n---\n") + 1
     assert comment_start > signed_off_end
     acked_by_text = ""
@@ -94,6 +105,7 @@
         acked_by_names += f"{ack}\n"
     patch_text_mod = (
         patch_text[:signed_off_end]
+        + signed_off_text
         + acked_by_text
         + patch_text[signed_off_end:comment_start]
         + f"""
@@ -102,6 +114,7 @@
 
 Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid}
 This mail reflects revision {details["revision"]} of this Change.
+{signed_off_comment}
 Acked-by according to Gerrit (reflected above):
 {acked_by_names}
         """

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa
Gerrit-Change-Number: 530
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/530?usp=email )

Change subject: gerrit-send-mail: add missing Signed-off-by
......................................................................

gerrit-send-mail: add missing Signed-off-by

Our development documentation says we add this automatically when it is missing. So let's do that here as well.

Change-Id If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28362.html

---
M dev-tools/gerrit-send-mail.py

1 file changed, 13 insertions(+), 0 deletions(-)
dev-tools/gerrit-send-mail.py +13 -0
index 67a2cf1..10305e2 100755
@@ -50,6 +50,12 @@
                 ack = f"{reviewer_name} <{reviewer_mail}>"
                 print(f"Acked-by: {ack}")
                 acked_by.append(ack)
+    # construct Signed-off-by in case it is missing
+    owner = json_data["owner"]
+    owner_name = owner.get("display_name", owner["name"])
+    owner_mail = owner.get("email", owner["name"])
+    sign_off = f"{owner_name} <{owner_mail}>"
+    print(f"Signed-off-by: {sign_off}")
     change_id = json_data["change_id"]
     # assumes that the created date in Gerrit is in UTC
     utc_stamp = (
@@ -67,6 +73,7 @@
         "target": json_data["branch"],
         "msg_id": msg_id,
         "acked_by": acked_by,
+        "sign_off": sign_off,
     }
 
 
@@ -81,10 +88,14 @@
 
 def apply_patch_mods(patch_text, details, args):
     comment_start = patch_text.index("\n---\n") + len("\n---\n")
+    signed_off_text = ""
+    signed_off_comment = ""
     try:
         signed_off_start = patch_text.rindex("\nSigned-off-by: ")
         signed_off_end = patch_text.index("\n", signed_off_start + 1) + 1
     except ValueError:  # Signed-off missing
+        signed_off_text = f"Signed-off-by: {details['sign_off']}\n"
+        signed_off_comment = "\nSigned-off-by line for the author was added as per our policy.\n"
         signed_off_end = patch_text.index("\n---\n") + 1
     assert comment_start > signed_off_end
     acked_by_text = ""
@@ -94,6 +105,7 @@
         acked_by_names += f"{ack}\n"
     patch_text_mod = (
         patch_text[:signed_off_end]
+        + signed_off_text
         + acked_by_text
         + patch_text[signed_off_end:comment_start]
         + f"""
@@ -102,6 +114,7 @@
 
 Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid}
 This mail reflects revision {details["revision"]} of this Change.
+{signed_off_comment}
 Acked-by according to Gerrit (reflected above):
 {acked_by_names}
         """

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa
Gerrit-Change-Number: 530
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged